
Page({
    data:{
        dishes: [],
        goodsDetail: '',
        detailFlag: false
    },
    onLoad: function(){
        let pages = getCurrentPages();
        let prevPage = pages[pages.length - 2];
        console.log(prevPage)
        let dishes = prevPage.data.shop.designdish;
        // dishes.forEach( val => {
        //     if(val.dish == undefined){
        //         val.dish = []
        //     }
        // });
        this.setData({
            dishes: dishes
        })
    },

    //查看商品详细
    goodsDetail(e){
        this.setData({
            goodsDetail: e.detail,
            detailFlag: true
        })
        console.log(this.data.goodsDetail)
    }
})